<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <!-- Loading Bootstrap -->
	    <link href="{{__PUBLIC__}}/Admin/Flat//dist/css/vendor/bootstrap.min.css" rel="stylesheet">
	    <!-- Loading Flat UI -->
	    <link href="{{__PUBLIC__}}/Admin/Flat//dist/css/flat-ui.css" rel="stylesheet">
	    <link href="{{__PUBLIC__}}/Admin/Flat//docs/assets/css/demo.css" rel="stylesheet">
	    <link rel="shortcut icon" href="{{__PUBLIC__}}/Admin/Flat//img/favicon.ico">
	    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
	    <!--[if lt IE 9]>
	      <script src="dist/js/vendor/html5shiv.js"></script>
	      <script src="dist/js/vendor/respond.min.js"></script>
	    <![endif]-->

	    
	    <script type="text/javascript" src="{{__PUBLIC__}}/jquery-1.7.2.min.js"></script>
	    <script type="text/javascript">
	    $(function(){
	    	$('#img_close').click(function(){
	    		$('#img_box').remove();
	    		$('#file_img').html('<input type="file" name="thumb" value="">');
	    	});
	    })
	    </script>
	</head>
	<body>
		<form action="" method="post" enctype="multipart/form-data">
		<div class="alert alert-success">修改文章</div>
		<div class="form-group">
			<label for="exampleInputEmail1">文章标题</label>
			<input id="exampleInputEmail1" class="form-control" type="text" placeholder="请输入文章标题" required="" name="title" value="{{$olddata['title']}}">
		</div>
		<div class="form-group">
			<label for="exampleInputEmail1">作者</label>
			<input id="exampleInputEmail1" class="form-control" type="text" placeholder="请输入作者" required="" name="author" value="{{$olddata['author']}}">
		</div>
		<div class="form-group">
			<label for="exampleInputEmail1">所属分类</label>
			<select name="category_cid" class="form-control">

				{{foreach from="$cateData" key="$key" value="$value"}}
				<!-- 默认选中 <option value=1 selected='selected'>	-->
				<option value="{{$value['cid']}}"{{if value="$value['cid']==$olddata['category_cid']"}}selected{{endif}}>{{$value['cname']}}</option>
				{{endforeach}}
			</select>
		</div>
		<div class="form-group">
			<label for="exampleInputEmail1">缩略图</label>
			{{if value="isset($olddata['thumb']) && !empty($olddata['thumb'])"}}
			<div id="img_box">
				<img src="{{__ROOT__}}/{{$olddata['thumb']}}" alt="">
				<a href="javascript:;" id="img_close">X</a>
				<input type="hidden" name="thumb" value="{{$olddata['thumb']}}"> 
			</div>
			{{else}}
			<input id="exampleInputEmail1" type="file" required="" name="thumb">
			{{endif}}
			<div id="file_img"></div>
		</div>
		
		
		<div id="">
			<label for="">文章标签</label>
			<br />
			{{foreach from="$tagData" key="$k" value="$v"}}
			<label class="checkbox checkbox-inline" >
				<input id="checkbox1" class="custom-checkbox" type="checkbox" data-toggle="checkbox" value="{{$v['tid']}}"  name='tid[]' {{if value="in_array($v['tid'],$tags)"}} checked {{endif}}>

				<span class="icons">
				<span class="icon-unchecked"></span>
				<span class="icon-checked"></span>
				</span>
				{{$v['tname']}}
			</label>
			{{endforeach}}
		</div>
		<div class="form-group">
			<label for="exampleInputEmail1">文章摘要</label>
			<textarea name="digest" rows="5" cols=""  class="form-control" placeholder="请输入文章摘要">{{$olddata['digest']}}</textarea>
		</div>
		<div class="form-group">
			<label for="exampleInputEmail1">文章关键字</label>
			<textarea name="keywords" rows="5" cols=""  class="form-control" placeholder="请输入文章关键字">{{$olddata['keywords']}}</textarea>
		</div>
		<div class="form-group">
			<label for="exampleInputEmail1">文章描述</label>
			<textarea name="des" rows="5" cols=""  class="form-control" placeholder="请输入文章描述">{{$olddata['des']}}</textarea>
		</div>
		<div class="form-group">
			<label for="exampleInputEmail1">文章正文</label>
			<textarea name="content" rows="5" cols=""  class="form-control" placeholder="请输入文章正文">{{$olddata['content']}}</textarea>
		</div>
		<input type="hidden" value="{{Q('get.aid',0,'interval')}}" name="aid">
		<button class="btn btn-primary btn-block" type="submit"> 确定 </button>
		</form>
	</body>
</html>
